import Vue from 'vue'
import Vuex from 'vuex'
import persist from "vuex-persistedstate"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token:''
  },
  getters: {
    token(state){
      return state.user.token
    }

       /**
     * 
     * token
     */

  },
  mutations: {
    setUser(state,payload){
      state.user=payload
    },
    setMenus(state,payload){
      state.menus=payload
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[
    new persist({
      storage:window.localStorage
    })
  ]
})
